
<!-- Showcase List { -->
<div class="panel-left">
<?
	$rs = $db->query("SELECT * FROM ".$prefix."loaisanpham where c_hienthi = 1 AND c_id_cha = 0");
	$tr = 0;
	$color = 0;
	while($row = $db->fetch_array($rs)){
		$c_ten = stripcslashes($row[c_ten]);
		$c_id = $row[c_id];
	    $color++;	
		if($color == 6){$color = 1;}
		
		
		//Lay danh sach cac id subcat
		$listId = layDanhSachSubCatId($c_id);
		$rs2 = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_hienthi = 1 AND t_loaisanpham IN(".$listId.") order by t_id DESC LIMIT 1");

if($db->num_rows($rs2) != 0){


		$row2 = $db->fetch_array($rs2);
		$t_id = $row2[t_id];
		$t_tieude = stripslashes($row2[t_tieude]);
		$t_hinhanh = $row2[t_hinhanh];
		$t_mota = stripslashes($row2[t_mota]);
		$t_giacu = stripslashes($row2[t_giacu]);
		$t_giaban = stripslashes($row2[t_giaban]);
		$t_tinhthanh = layTinhThanh($row2[t_tinhthanh]);
		$t_loaitien = loadLoaiTien($row2[t_loaitien]);
		$t_nguoidang = $row2[t_nguoidang];
		$t_ten_nguoidang = tenNguoiDung($t_nguoidang);
?>
<!-- showcase { -->

<div class="showcase">	
	<div class="title">
		<p class="color-left showcase0<?=$color?>"></p>
		<h5 class="color-body" style="font-size:13px;">
			<a href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>" title="<?=$c_ten?>"><?=$c_ten?></a>
		</h5>
	</div>
	<div class="top-product">
	
		<p class="picture">
			<a title="<?=$t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>/<?=$myString->vietdecode($t_tieude)?>"><img title="<?=$t_tieude?>" src="<?=$root?>/<?=$PathThumbFile?><?=$t_hinhanh?>" alt="<?=$t_tieude?>" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';"/></a>
		</p>
		<div class="info">
			<ul>
				<li class="header-info"><a class="link" title="<?=$t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>"><?=$t_tieude?></a>
				</li>
				
				<li>Giá bán: <label class="price"><?=showprice($t_giaban) ." ". $t_loaitien?></label></li>
				
				<li>Khu vực: <?=$t_tinhthanh?></li>				
				<li>Người bán: <a class="popup-profile" title="<?=$t_ten_nguoidang?>" href="<?=$root?>/shop-<?=$t_nguoidang?>/<?=tenNguoiDung2($t_nguoidang)?>"><?=$t_ten_nguoidang?></a></li>				
			</ul>
		</div>
		<div class="view-more">
			<a title="<?=$c_ten?>" href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>">Xem thêm</a>
		</div>
	</div>
	<div class="more-product">
		<ul>

			<?
				$rs3 = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_hienthi = 1 AND t_loaisanpham IN(".$listId.") AND t_id != ".$t_id." order by t_id DESC LIMIT 4");
				$t = 0;
				while($row3 = $db->fetch_array($rs3)){
				$t++;
				$s_t_id = $row3[t_id];
				$s_t_tieude = stripslashes($row3[t_tieude]);
				$s_t_giaban = stripslashes($row3[t_giaban]);
				$s_t_loaitien = loadLoaiTien($row3[t_loaitien]);
				$s_t_ten_nguoidang = tenNguoiDung($t_nguoidang);
			?>

	        <li <? if($t == $db->num_rows($rs3)){?> class="last" <? } ?>>
			        <a class="link" title="<?=$s_t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$s_t_id?>/<?=$myString->vietdecode($s_t_tieude)?>"><?=$s_t_tieude?> - <span style="color: red;"><?=showprice($s_t_giaban)?> <?=$s_t_loaitien?></span></a>
					<img src="<?=$root?>/themes/images/product-new.gif" alt="<?=$s_t_tieude?>" />
			
			</li>
			<? } ?>	
      </ul>
	</div>	
</div>
	
<!-- } showcase -->

<? }//end if($db->num_rows($rs2)) ?>


	<?
		$st++;
		if($st % 2 != 0){
	?>
        <div class="showcase-space"></div>  
	<? }?>
		
<? } ?>        

<div class="clear-showcase"></div>
     
				<!-- } Showcase List -->
</div>    
    